<?php $this->load->helper('HTML');
echo link_tag('css/style2.css');
echo link_tag('images/favicon.ico','shortcut icon','image/x-icon');
?></head>
<div id="page1">
<div id="wrapper">
    <?php $this->load->view('admin_views/header'); ?><hr />
    <script type="text/javascript">
        //for unit
        $(document).ready( function() {
            $("#intid_unit").autocomplete({
                minLength: 2,
                source:
                    function(req, add){
                    $.ajax({
                        url: "<?php echo base_url(); ?>penjualan/lookupUnitPerCabang001",
                        dataType: 'json',
                        type: 'POST',
                        data: req,
                        success:
                            function(data){
                            if(data.response =="true"){
                                add(data.message);
                            }
                        },
                    });
                },
                select:
                    function(event, ui) {
                    $("#result").append(
                    "<input type='hidden' id='id_unit' name='id_unit' value='" + ui.item.id + "' size='10' />"
                );
                },
            });

            $("#strnama_dealer").autocomplete({
                minLength: 2,
                source:
                    function(req, add){
                    $.ajax({
                        url: "<?php echo base_url(); ?>penjualan/lookupUpline",
                        dataType: 'json',
                        type: 'POST',
                        data: {
                            term: req.term,
                            state: $('#id_unit').val(),

                        },
                        success:
                            function(data){
                            if(data.response =="true"){
                                add(data.message);
                            }
                        },
                    });
                },
                select:
                    function(event, ui) {
                    $("#result").append(
                    "<input type='hidden' align='top' id='strkode_dealer' name='strkode_dealer' value='" + ui.item.id + "'/>"
                );
                },
            });

        });

</script>
</div>

<div id="page">
    <div id="page-bgtop">
        <div id="content">
            <div class="post">
                <fieldset>
                    <legend><strong>CETAK LAPORAN BOOM</strong></legend>
                    <form action="<?php echo base_url()?>laporan/excel" method="post" target="_blank">
                        <table width="95%" border="0" cellpadding="0" cellspacing="0" id="data" align="center">
                            <tr>
                                <td>&nbsp;PERIODE</td>
                                <td><input type="text" name="tglstart" id="demo2" size="25" /><a href="javascript:NewCssCal('demo2','yyyymmdd')"> <img src="<?php echo base_url();?>images/cal.gif" width="16" height="16" alt="Pick a date" /></a>&nbsp;&nbsp;TO&nbsp;&nbsp;<input type="text" name="tglend" id="demo3" size="25" /><a href="javascript:NewCssCal('demo3','yyyymmdd')"> <img src="<?php echo base_url();?>images/cal.gif" width="16" height="16" alt="Pick a date" /></a></td>
                            </tr>
                            <tr>
                                <td>&nbsp;UNIT : </td>
                                <td><input type="text" name="textfield4" id="intid_unit" /><div id="result"></div></td>
                            </tr>
                            <tr>
                                <td>&nbsp;NAMA DEALER : </td>
                                <td><input type="text" name="strnama_dealer" id="strnama_dealer"/></td>
                            </tr>
                            <tr>
                                <th></th>
                                <td><input type="submit" value="Cetak" id="submit" class="button"/>
                                    &nbsp;
                                    <input class="button" type="button" value="Cancel" onclick="location.href='index';"/>                </td>
                            </tr>
                        </table>
                    </form>
                </fieldset>
                <div id="loadingScreen"></div>
                <div id="message"></div>
      
            </div>
        </div>

    </div>
    <!-- end #content -->
    <?php $this->load->view('admin_views/sidebar_laporan'); ?><!-- end #sidebar -->
    <div style="clear: both;">&nbsp;</div>
</div>
</div>
<!-- end #page -->
<div id="footer-bgcontent">
    <?php $this->load->view('admin_views/footer'); ?></div>
<!-- end #footer -->

